/*
 * serialScope_sol.c
 *
 * Created: 10/30/2013 1:30:42 PM
 *  Author: Tim
 */ 

//FYI another "../" is in the solution file include call because these files are contained a directory one step deeper than the standard files
#include "../../src/Epiphany.h"

void setup()
{
	//put all your initializations here
	clockInit();
	usbInit(115200);	//the baud does not matter you just need to choose one
	adcInit();			//can't read from the ADC without this
	RTC_DelayInit();		//can't create RTC delays without calling this first
	
	sei();				//the serial port code is interrupt driven.  We have to have the
}

void loop()
{
	if(delayOver)
	{
		RTC_Delay_ms(5);
		
		int16_t conversion = analogRead(0);
		uint8_t numSpaces = conversion/210;
		uint8_t i;
			
		for(i=0;i<numSpaces;i++)
		{
			fprintf(&USB_str," ");
		}
			fprintf(&USB_str,"o\r");
	}
	
}